<template>
  <div class="shoperInfo">
    <div class="title">
      <img :src="getShopInfo.logo" alt="">
      <span>{{getShopInfo.name}}</span>
    </div>
    <div class="content">
      <div class="contentLeft">
        <div class="sellCount">
          <p class="sc">{{allSells}}</p>
          <p class="sT">总销量</p>
        </div>
        <div class="allCount">
          <p class="ac">{{getShopInfo.goodsCount}}</p>
          <p class="aT">全部宝贝</p>
        </div>
      </div>
      <div class="contentRight">
        <div class="item" v-for="(item,index) in getShopInfo.score" :key="index">
          <span>{{item.name}}</span>
          <span class="score" :style="item.isBetter?{color:'red'}:{color:'green'}">{{item.score}}</span>
          <span v-if="item.isBetter" class="high">高</span>
          <span v-else class="low">低</span>
        </div>
      </div>
    </div>
    <div class="enter">
      <a href="">进店逛逛</a>
    </div>
  </div>
</template>
<script>
export default {
  props:{
    getShopInfo:{
      type:Object,
      default:{}
    }
  },
  computed:{
    allSells(){
      return (this.getShopInfo.sells/10000).toFixed(1) + '万'
    }

  }
}
</script>
<style scoped>
.shoperInfo{
  border-top: 5px solid #eee;
  border-bottom: 5px solid #eee;
  padding-top: 10px;
}
.shoperInfo .title{
  height: 60px;
  display: flex;
  align-items: center;
  font-size: 15px;
}
.shoperInfo .title img{
  width: 40px;
  border-radius: 50%;
  margin:7px;
  margin-right: 10px;
}
.shoperInfo .content{
  display: flex;
  font-size:13px ;
  align-items: center;
}
.shoperInfo .content > div.contentLeft{
  flex:1;
  text-align: center;
  display: flex;
  padding:0 20px;
  height: 42px;
  border-right: 1px solid #ccc;
}
.shoperInfo .content .contentLeft > div{
  flex: 1;
}
.shoperInfo .content .contentLeft div p{
  line-height: 20px;
}
.shoperInfo .content .contentRight{
  padding:0 20px;
  line-height: 24px;
}
.shoperInfo .content .contentRight span{
  margin-right: 5px;
}
.shoperInfo .content .contentRight span.score{
  display: inline-block;
  width: 35px;
  margin-right: 0px;
}
.shoperInfo .content .contentRight span.high{
  color: #fff;
  background-color: red;
}
.shoperInfo .content .contentRight span.low{
  color: #fff;
  background-color: green;
}
.shoperInfo .enter{
  margin: 20px 0;
  text-align: center;
  font-size: 14px;
}
.shoperInfo .enter a{
  background-color: #eee;
  padding:3px 30px;
  border-radius: 10px;
  color:#666;
}
</style>